﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Boshii.Map.DAL.Common;

namespace Boshii.Map.Bll.Common
{
    public class BllBase
    {

        #region ExistsValue
        /// <summary>
        /// 检测表中指定字段是否存在相同值
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fieldsName"></param>
        /// <param name="filedValue"></param>
        /// <returns></returns>
        public virtual bool ExistSameVlue(string tableName, string fieldsName, string filedValue)
        {
            using (DalBase dal = new DalBase())
            {
                return dal.ExistSameVlue(tableName, fieldsName, filedValue);
            }
        }
        #endregion

        public bool ExistSameVlue_1(string tableName, string fieldName, string fieldValue, string pkFieldName, string pkFiedlValue)
        {
            using (DalBase dal = new DalBase())
            {
                return dal.ExistSameVlue_1(tableName, fieldName, fieldValue, pkFieldName, pkFiedlValue);
            }
        }

        enum ServerType
        {
            WebServer,
            SqlServer,
            OracleServer
        }

        /// <summary>
        /// 取得服务器当前时间
        /// <remarks>
        /// 项目中所有取服务器当前时间都必须调用此方法
        /// 可以根据需要实现取web服务器时间或者数据库时间
        /// 此方法不可重写
        /// </remarks>
        /// </summary>
        /// <returns></returns>
        public DateTime GetServerCurrentTime()
        {
            return DateTime.Now;
        }
    }
}
